class Trip < ActiveRecord::Base
	belongs_to :user
	has_many :user_trip, :dependent => :destroy
	has_many :user, :through => :user_trip
	has_many	:itinerary, :dependent => :destroy
	
	validates_presence_of :tri_country, :tri_city, :tri_lodging, :tri_start_date, :tri_end_date
	
	
	validates_length_of       :tri_country,    :within => 1..100
	validates_length_of       :tri_city,       :within => 1..100
	validates_length_of		  :tri_lodging,    :within => 1..100
end
